<template>
<view>

<view style="overflow: hidden;height: 360rpx;position: relative;background: #fff" v-if="diyitem.params.style=='default1'">
    <view class="member-head" style="z-index:100;border: none;">
        <view class="child">
            <view class="title" :style="'color:' + diyitem.style.textcolor||''">{{member.moneytext}}</view>
            <view class="number" :style="'color:' + diyitem.style.textlight||''">{{member.credit2}}</view>
            <navigator class="btn" hoverClass="btn-hover" openType="navigate" :style="'color:' + diyitem.style.textcolor||'' + ';border-color:' + diyitem.style.textcolor||''" :url="diyitem.params.leftnavlink" v-if="member.open_recharge">{{diyitem.params.leftnav}}</navigator>
        </view>
        <view class="child userinfo">
            <view :class="'avatar ' + diyitem.style.headstyle||''">
                <image class="icon" :src="member.avatar||'/static/static/images/noface.png'"></image>
            </view>
            <view class="nickname">{{member.nickname||'未更新用户信息'}}</view>
            <view class="level">{{member.levelname}}</view>
            <view class="btn" @tap="navigate" v-if="!member.nickname">登4录</view>
        </view>
        <view class="child">
            <view class="title" :style="'color:' + diyitem.style.textcolor||''">{{member.credittext}}</view>
            <view class="number" :style="'color:' + diyitem.style.textlight||''">{{member.credit1}}</view>
            <navigator class="btn" hoverClass="btn-hover" :style="'color:' + diyitem.style.textcolor||'' + ';border-color:' + diyitem.style.textcolor||''" :url="diyitem.params.rightnavlink" v-if="member.open_creditshop==1">{{diyitem.params.rightnav}}</navigator>
        </view>
    </view>
    <view class="member_header" :style="'background:' + diyitem.style.background + ';border-color:' + diyitem.style.background"></view>
    <block v-if="member.usemembercard">
        <navigator class="member_card" hoverClass="none" openType="navigate" :url="'/pages/member/membercard/index?hasmembercard=' + member.hasmembercard">
            <image class="icon" src="/static/static/images/icon-huangguan.png"></image>
            <view class="title">我的会员卡</view>
            <view class="card-num">已拥有{{member.hasbuycardnum}}张</view>
        </navigator>
        <image class="cover-img" src="/static/static/images/cover.png"></image>
    </block>
</view>
<view class="headinfo style-2" :style="'background:' + diyitem.style.background + ';'" v-else>
    <navigator class="icon-style2" hoverClass="none" openType="navigate" :url="'/pages/member/membercard/index?hasmembercard=' + member.hasmembercard" v-if="member.usemembercard">
        <image src="/static/static/images/header-style2.png"></image>
    </navigator>
    <navigator class="setbtn" :url="diyitem.params.setlink">
        <i :class="'icox ' + diyitem.params.seticon"></i>
    </navigator>
    <view :class="'face ' + diyitem.style.headstyle||''">
        <image class="icon" :src="member.avatar||'/static/static/images/noface.png'"></image>
    </view>
    <view class="inner">
        <view class="name" :style="'color:' + diyitem.style.textcolor||''">{{member.nickname||'未更新'}}</view>
        <view class="level" :style="'color:' + diyitem.style.textcolor||''" v-if="member.levelname">{{member.levelname||'-'}}</view>
        <view class="credit" :style="'color:' + diyitem.style.textcolor||''" v-if="member.credit2">{{member.moneytext}} :<text :style="'color:' + diyitem.style.textlight||''" v-if="member.credit2">{{member.credit2||'-'}}</text>
        </view>
        <view class="credit" :style="'color:' + diyitem.style.textcolor||''" v-if="member.credit1">{{member.credittext}} :<text :style="'color:' + diyitem.style.textlight||''">{{member.credit1||'-'}}</text>
        </view>
        <view @tap="navigate" class="facebtn" v-if="!member.nickname">登1录</view>
    </view>
</view>
</view>
</template>
<script>
export default {
	props: {
		diyitem:{
		type: Object,
		}
	},
	created() {
		console.log(this.diyitem)
	},
	methods:{
		navigate:function(e){
			this.$emit("gm",e)
		}
	}
}
</script>
